<template>
  <div id="map" />
</template>

<script setup>
import OlMap from './olMap.js'
import { onMounted } from 'vue'

import airport from './airport.json'

// functions
// 初始化openlayers
const creatOlMap = () => {
  const olMap = new OlMap('map', [119.7286, 32.0445], 'img')
  window.olMap = olMap
}

// 添加机场点
const addAirport = () => {
  olMap.addPoints(airport, {
    type: 'airport'
  })
}

onMounted(() => {
  creatOlMap()
  addAirport()
})
</script>
<style scoped lang='scss'>
#map{
  height: 100%;
  width: 100%;
}
</style>
